<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>机构列表 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head_list.html"/>
<script type="text/javascript">
$().ready(function() {

	var $listForm = $("#listForm");
	var $filterSelect = $("#filterSelect");
	var $filterOption = $("#filterOption a");
	
	// 订单筛选
	$filterSelect.mouseover(function() {
		var $this = $(this);
		var offset = $this.offset();
		var $menuWrap = $this.closest("div.menuWrap");
		var $popupMenu = $menuWrap.children("div.popupMenu");
		$popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
		$menuWrap.mouseleave(function() {
			$popupMenu.hide();
		});
	});
	
	// 筛选选项
	$filterOption.click(function() {
		var $this = $(this);
		var $dest = $("#" + $this.attr("name"));
		if ($this.hasClass("checked")) {
			$dest.val("");
		} else {
			$dest.val($this.attr("val"));
		}
		$listForm.submit();
		return false;
	});
	var filterStatus = '${filterStatus!}';
	$.each($filterOption,function(i,e){
		var $this = $(this);
		if( $this.attr("val") == filterStatus ){
			$this.addClass('checked');
		}
	})
	<#if pagination.totalCount==0>
		$.message("warn", "暂无数据！");
	</#if>
});
</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 机构列表 <span>(共<span id="pageTotal">${pagination.totalCount!0}</span>条记录)</span>
	</div>
	<form id="listForm"  class="clearfix" action="v_list.jspx" method="post">
		<div class="bar">
			<a href="v_add.jspx" class="iconButton">
				<span class="addIcon">&nbsp;</span>添加
			</a>
			<div class="buttonWrap">
				<a href="javascript:;" id="deleteButton" class="iconButton disabled">
					<span class="deleteIcon">&nbsp;</span>删除
				</a>
				<a href="javascript:;" id="refreshButton" class="iconButton">
					<span class="refreshIcon">&nbsp;</span>刷新
				</a>
				<#include "../pageselect.html"/>
			</div>
			<div class="menuWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">&nbsp;</span>
					<input type="text"  id="searchValue" name="searchValue" value="${searchValue!}" maxlength="200" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
						<li><a href="javascript:;" val="intermediaName">名称</a></li>
						<li><a href="javascript:;" val="username">登录名</a></li>
						<li><a href="javascript:;" val="email">Email</a></li>
						<li><a href="javascript:;" val="mobile">手机</a></li>
					</ul>
				</div>
			</div>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check"><input type="checkbox" id="selectAll" /></th>
				<th><a href="javascript:;" class="sort" name="username">管理账号</a></th>
				<th><a href="javascript:;" class="sort" name="intermediaName">机构名称</a></th>
				<#if admin.system><th><a href="javascript:;" class="sort" name="parent.id">上级机构</a></th></#if>
				<th><span>推荐商</span></th>
				<th><span>推荐账号</span></th>
				<th><span>交易编码开始</span></th>
				<th><span>交易编码结束</span></th>
				<th><span>代理商数</span></th>
				<th><span>客户数</span></th>
				<th><span>账户资金</span></th>
				<th><span>操作</span></th>
			</tr>
			<#list pagination.list as c>
				<tr>
					<td><input type="checkbox" name="ids"  title=""  value="${c.id!}" /></td>	
					<td>${c.username!}</td>
					<td>
						${c.intermediaName!}
					</td>
					<#if admin.system>
					<td>
					<#if c.parent?? && c.parent.intermediaName??>
					<span class="blue">${c.parent.intermediaName!}</span><#else><span class="red">顶级机构</span>
					</#if>
					</td>
					</#if>
					<td>${c.ext.recommentAgent!}</td>
					<td>${c.ext.recommentAccount!}</td>
					<td>${c.ext.tradersCodingBegins!}</td>
					<td>${c.ext.tradersCodingEnds!}</td>
					<td>${c.childCount!0}</td>
					<td>${c.userCount!0}</td>
					<td><span class="red">${c.ext.accountFunds!0}</span></td>
					<td>
						<a href="v_edit.jspx?id=${c.id!}">[编辑]</a>
						<@betou_perm url="/funds/v_list.jspx">
						&nbsp;&nbsp;<a href="../funds/v_list.jspx?id=${c.id}" target="mainFrame">[短信设置]</a>
						</@betou_perm>
					</td>
				</tr>
			</#list>
		</table>
		<#include "../list_hidden.html" />
		<#include "../page.html" />
	</form>
</body>
</html>